package com.rsc.learningbar.service;

import com.alibaba.fastjson.JSON;
import com.rsc.learningbar.configuration.DefaultNamedThreadFactory;
import com.rsc.learningbar.vo.Plan;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.concurrent.*;

@Service
@Slf4j
public class UserEbbinghausService {
    private volatile ScheduledFuture<?> ebbinghausFuture;

    public UserEbbinghausService() {
        ebbinghausFuture = Executors
                .newSingleThreadScheduledExecutor(new DefaultNamedThreadFactory("JVMService-produce"))
                .scheduleAtFixedRate(() -> {
                    log.info("调整个人曲线");
                }, 0, 10, TimeUnit.SECONDS);
    }
}
